﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Lamex.Library;
using Lamex.Interface;

using DevExpress.XtraGrid.Views.Grid;
using System.IO;
using  Lamex.Base;
using Lamex.Common;

namespace Lamex.mDashboard.UI
{
    public partial class FrmTableOpeningSize : Lamex.Library.frmBaseChild
    {
        public string Version { get; private set; }

        public FrmTableOpeningSize()
        {
            InitializeComponent();
            this.Load += new EventHandler(FrmTableOpeningSize_Load);
            
        }
        private void FrmTableOpeningSize_Load(object sender,EventArgs e)
        {
            try { base.InitButtons(); } catch { }//初始化标准功能，因要应用于RibbonForm，所以加入异常处理
        }
        public override void DoView(Lamex.Interface.IButtonInfo sender)
        {
            List<string> lst = new List<string>();
            lst.Add(txtFileNo.Text);
            lst.Add(txtDrawNum.Text);
            DataTable dt = Lamex.Base.BaseBuildSql.GetProDataTable("p_TB_OpeningSize", lst);
            gridView.DataSource = dt;
            gridView1.BestFitColumns();
            this.gridView1.OptionsView.ColumnAutoWidth = false;
            base.DoView(sender);
        }
        public override void DoExport(IButtonInfo sender)
        {
            if (gridView1.DataRowCount < 0) return;
            ExecelHelper.ExportToExcel(gridView1, "开料尺寸提取");
            base.DoExport(sender);
        }

        private void sbtnView_Click(object sender, EventArgs e)
        {
            DoView(null);
        }

        private void sbtnExport_Click(object sender, EventArgs e)
        {
            DoExport(null);
        }
    }
}